<?php

class PageAction extends Action 
{

	public function detail()
	{	
		
		$key=isset($_GET['key'])?trim($_GET['key']):'';
		if($key=='')
		{
			$url=__APP__.'/Index';
			redirect($url);return;
		}
		$condition['key']=$key;
		$temp=D("Page")->find($condition);
		if(!$temp)
		{
			$url=__APP__.'/Index';
			redirect($url);return;
		}		
		$this->assign('info',$temp);
		$this->display();
	}
	public function _empty()
	{
		$url=ACTION_NAME;
		if($url=='')
		{
			$url=__APP__.'/Index';
			redirect($url);return;
		}
		$condition['url']=$url;
		$temp=D("Page")->find($condition);
		$this->assign('info',$temp);
		$this->display('detail');		
	}	
}
?>